import request from '@/utils/request.js';

// 获取商品列表数据
export const getGoodApi = (params) => {
  return request({
    method: 'GET',
    url: 'goods',
    params
  });
};

// 删除商品
export const deletGoods = (id) => {
  return request({
    method: 'DELETE',
    url: `goods/${id}`
  });
};

//  根据 ID 查询商品
export const getGoodsApi = (id) => {
  return request({
    method: 'GET',
    url: `goods/${id}`
  });
};

//  编辑提交商品
export const editCommitGoodsApi = (id, data) => {
  return request({
    method: 'PUT',
    url: `goods/${id}`,
    data
  });
};

